import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-player',
  templateUrl: './player.component.html',
  styleUrls: ['./player.component.less']
})
export class PlayerComponent implements OnInit {

public url:string = ""
public imgUrl:string = 'http://s4.music.126.net/style/web2/img/default/default_avatar.jpg?param=50y50'
public playStatus:boolean=true


  constructor() { }

  ngOnInit(): void {
   }



play(){
  const mA:any = document.querySelector("#myAudio")

  if(mA.paused){
    this.playStatus=true
    mA.play();
    
}else{
  this.playStatus=false
  mA.pause();
  console.log((mA.duration*1000)/60000);
  console.log((mA.currentTime*1000)/60000);
}
}

showPlayer(){
  const cot:any = document.querySelector('.audioBody')
  cot.style.display = "block"
  
}

hidePlayer(e:any){
  const cot = e.target
  cot.style.display = "none"
}

}
